scrolledwindow: Fix a11y support code
authorMatthias Clasen <mclasen@redhat.com>
Tue, 4 Aug 2020 15:00:32 +0000 (11:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 4 Aug 2020 15:00:32 +0000 (11:00 -0400)
This error was introduced by me in 971ee2d28a65b816050c
and causes a crash in the scrolling benchmark in gtk-demo.

Fixes: #3014
gtk/gtkscrolledwindow.c

index a2f8fcaf4e341930bfcc816e5998bbc769897773..7af5ce05638d7b250959904cf33d4d4b79ca9bd2 100644 (file)
@@ -4195,7 +4195,10 @@ gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window,
                     NULL);
     }
 
-  list = g_list_append (NULL, priv->child);
+  if (priv->child)
+    list = g_list_append (NULL, priv->child);
+  else
+    list = NULL;
   gtk_accessible_update_relation (GTK_ACCESSIBLE (priv->hscrollbar),
                                   GTK_ACCESSIBLE_RELATION_CONTROLS, list,
                                   -1);